package 我的Java学习_算法基础.day_02;

import java.util.Scanner;

public class _026_小白上楼梯 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int res = f(n);
        System.out.println(res);
    }
    static int f(int n){
        if(n==1) return 1;
        if(n==2) return 2;
        if(n==3) return 4;
        return f(n-1)+f(n-2)+f(n-3);
    }

}
